#pragma once
#include <iostream>
#include <string>
#include <sys/types.h>
#include <cstdlib>
#include <ctime>
#include <unistd.h>
#include <sys/ipc.h>
#include <sys/shm.h>
using namespace std;

string GetCurrTime()
{
    time_t t = time(nullptr);
    struct tm *curr = localtime(&t);
    char currtime[32];
    snprintf(currtime, sizeof(currtime), "%d-%d-%d %d:%d:%d", // 将后面的格式化输入到currtime中
    curr->tm_year + 1900,
    curr->tm_mon + 1,
    curr->tm_mday,
    curr->tm_hour,
    curr->tm_min,
    curr->tm_sec
    );
    return currtime;
}